<?php
$this->load->helper('form');
$attributes = array('onsubmit' => 'userEditRequest('.$user_id.'); return false;');
echo form_open('#',$attributes);
?>
<table>
	<tr>
		<td class='form-field'> <strong> Nickname :</strong></td>
		<td><?php
		$data = array (
			'name' => 'nickname',
			'id' => 'nickname',
			'maxlength' => '30',
			'size' => '30',
			'onKeyUp' => 'validateUser(\'nickname\')',
			'value' => $nickname
		);
		echo form_input($data);
		?>
		</td>
	</tr>
	
	<tr>
		<td class='form-field'> <strong> Password :</strong></td>
		<td><?php
		$data = array (
			'name' => 'pwd1',
			'id' => 'pwd1',
			'maxlength' => '30',
			'size' => '30',
			'value' => ''
		);
		echo form_password($data);
		?>
		</td>
	</tr>
	
	<tr>
		<td class='form-field'> <strong> Password (checked) :</strong></td>
		<td><?php
		$data = array (
			'name' => 'pwd2',
			'id' => 'pwd2',
			'maxlength' => '30',
			'size' => '30',
			'value' => ''
		);
		echo form_password($data);
		?>
		</td>
	</tr>
	
	<tr>
		<td class='form-field'> <strong> First Name :</strong></td>
		<td><?php
		$data = array (
			'name' => 'firstname',
			'id' => 'firstname',
			'maxlength' => '50',
			'size' => '30',
			'value' => $firstname
		);
		echo form_input($data);
		?>
		</td>
	</tr>
	
	<tr>
		<td class='form-field'> <strong> Last Name :</strong></td>
		<td><?php
		$data = array (
			'name' => 'lastname',
			'id' => 'lastname',
			'maxlength' => '50',
			'size' => '30',
			'value' => $lastname
			
		);
		echo form_input($data);
		?>
		</td>
	</tr>
	
	<tr>
		<td class='form-field'> <strong> E-mail :</strong></td>
		<td><?php
		$data = array (
			'name' => 'email',
			'id' => 'email',
			'maxlength' => '100',
			'size' => '50',
			'value' => $email
			
		);
		echo form_input($data);
		?>
		</td>
	</tr>
	<?php $canaddmod = false; if ($this->auth->has_rights_to("add", "mod")) $canaddmod = true; ?>
	<tr<? if(!$canaddmod) echo ' style="{display:none}"';?>>
		<td class='form-field'> <strong> Rights :</strong></td>
		<td><?php
		$options = array();
		$options[1] = 'User';
		if ($canaddmod)
			$options[2] = 'Moderator';
		if ($this->auth->has_rights_to("add", "smod") || $rights == 3)
			$options[3] = 'Super-Moderator';
		if ($this->auth->has_rights_to("add", "admin") || $rights == 4)
			$options[4] = 'Admin';
		echo form_dropdown('rights', $options, $rights, 'id="rights"');
		?>
		</td>
	</tr>
	
	<tr>
		<td class='form-field'>
		<?php echo form_submit('submit', 'Send');?>
		</td>
	</tr>
</table>

<?php
echo form_close('');
?>